﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Web.Security;
using ZHDJ.Core;
using ZHDJ.Data;
using ZHDJ.Data.DataCaching;
using ZHDJ.Data.Models.Org;
using ZHDJ.WebPage.Master;
using ZHDJ.WebPage.Picker;

namespace ZHDJ.WebPage
{
    public class PortalPage: UsePickerPageBase
    {
        /// <summary>
        /// 是否启用picker
        /// </summary>
        public override bool IsEnabledPicker
        {
            get { return false; }

        }

        #region js脚本相关

        /// <summary>
        /// 弹出提示框
        /// </summary>
        /// <param name="content">内容</param>
        /// <param name="key">键值</param>
        public void Alert(string content, string key = "tip")
        {
            ClientScript.RegisterStartupScript(this.GetType(), key,string.Format(";alert('{0}');", content),true);
        }

        /// <summary>
        /// 输出脚本
        /// </summary>
        /// <param name="js">脚本</param>
        /// <param name="key">键值</param>
        public void RegisterJs(string js, string key = "tip")
        {
            ClientScript.RegisterStartupScript(this.GetType(), key, string.Format(";{0};", js), true);
        }

        protected override void OnPreLoad(EventArgs e)
        {
            base.OnPreLoad(e);
            
            Title = SystemParameterCaching.Get(SystemParameterKey.WebArticleHostName);
        }
        #endregion


    }
}
